<template>
  <div class="page" id="roomDetail">
    <div class="page__bd">
      <div class="weui-tab">
        <div class="weui-tab__panel">
          <div class="weui-tab__panel_top">
            <i @click="goBack" class="el-icon-arrow-left return-back"></i>
            <div class="top_title">
              <p>{{spaceData.name}}</p>
            </div>
          </div>
          <div class="weui-tab__panel_bd">
            <div class="innerBox">
            <div class="swipeWrapper">
            <van-swipe @change="onChange" :autoplay="5000">
              <van-swipe-item v-for="(item ,index) in imgList" :key="index"><img :src="item.imgUrl" alt=""></van-swipe-item>
              <div class="custom-indicator" slot="indicator">
                <span>0{{ current + 1 }}</span>/03
              </div>
            </van-swipe>
            </div>
            <div class="space-info">
              <div class="space-title">{{spaceData.name}}</div>
              <div class="space-tags" v-if="spaceData.equipments[0]">
                <span v-for="(item ,index) in spaceData.equipments" :key="index">{{item}}</span>
              </div>
              <div class="space-list">
                <div class="space-item halfwidth-item">
                  <span class="span-left">容纳人数：</span>
                  <span class="span-right">{{spaceData.contain}}人</span>
                </div>
                <div class="space-item">
                  <span class="span-left">地理位置：</span>
                  <span class="span-right">{{spaceData.address}}</span>
                </div>
              </div>
            </div>
            <div class="space-block">
              <div class="space-block-title">会议室详情</div>
              <div class="space-block-content">
                <div class="space-passage">平台工作室配置办公桌、椅、文件柜等办公家具，提供空调、网络配套到位，入驻机构可以实现“拎包试制”的便捷创业梦想。平台设立了集商务洽谈、产品展示、沙龙论坛等多功能为一体的商务中心，以及会议室，供学习交流，参观访问。</div>
                <div class="space-passage">特色描述：长三角创业汇免费办理公司注册、创业辅导、财务记账、税务咨询、创业孵化、创新大赛、创业营活动、项目转化、创新基金申报、交流合作、市场调研、宣传推广、会务会展、评估认证、法律援助、资金扶持等，为青年创业者提供信息、渠道、场地、资金等支持和服务。</div>
                <div class="space-passage">地点描述：交通便利，可乘坐公交或地铁，及多处基础设施建设，银行、医院、餐饮、超市等。</div>
              </div>
            </div>
            <div class="space-block">
              <div class="space-block-title">预订须知</div>
              <div class="space-block-content">
                <div class="space-passage">1.预定成功后凭借订单短信在预定时间入驻会议室;如遇手机短信删除,或无法上网的情况,您可以致电 客服电话为您重新发送订单信息</div>
                <div class="space-passage">2.预定后如需退订,请在预定时间开始24小时前取消订单,详情可查看退订政策</div>
              </div>
            </div>
            </div>
            <div class="container-footer">
              <span class="apply-btn">我要预订</span>
            </div>
            </div>
          </div>
        </div>
      </div>
  </div>
</template>

<script>
    export default {
        name: "RoomDetail"
      ,data(){
          return{
            current:null
            ,imgList:[
              {
                id:0
                ,imgUrl:"http://139.196.218.128/SjPark/UserFile/Files/Thumbnail/46932530-4bc8-48dc-bf10-1e5e39d254b8_750x470.png"

              }
              ,{
                id:1
                ,imgUrl:"http://139.196.218.128/SjPark/UserFile/Files/Thumbnail/73efa039-6c54-43c6-8ad9-70f831723e2e_750x470.png"
              }
              ,{
                id:1
                ,imgUrl:"http://139.196.218.128/SjPark/UserFile/Files/Thumbnail/eb8bbf4d-e236-4c92-900c-67d8b941b02a_750x470.png"
          }
            ]
            ,spaceData:{
              name:''
              ,equipments:[]
              ,contain:''
              ,address:'上海市松江区莘砖公路518号双子楼1楼'
            }
          }
      }
      ,methods:{
        goBack() {
          this.$router.go(-1);
        }
        ,onChange(index) {
          this.current = index;
        }
      }
      ,mounted() {
          this.spaceData.name = this.$route.query.title;
          this.spaceData.contain = this.$route.query.contain;
          this.spaceData.equipments = this.$route.query.equipments.split(',');
      }
    }
</script>

<style scoped>
  .weui-tab__panel{
    overflow: unset;
  }
  .innerBox{
    height:100%;
    overflow-y: scroll;
  }
  .weui-tab__panel_bd{
    padding: 4px;
    box-sizing: border-box;
  }
  .swipeWrapper img{
    width: 100%;
    height: 180px;
  }
  .swipeWrapper .custom-indicator{
    background-color: rgba(0,0,0,0.3);
    position: absolute;
    display: inline-block;
    z-index: 9;
    bottom: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 3px;
  }
  .container-footer {
    width: 100%;
    display: flex;
    height: 40px;
    border-top: 1px solid #ddd;
    background: #fff;
    text-align: center;
  }
  .custom-indicator span{
    color: #fff;
    font-size: 17px;
  }
  .space-title {
    font-size: 22px;
    line-height: 2;
  }

  .space-tags {
    margin-bottom: 10px;
  }

  .space-tags span {
    padding: 3px 8px;
    border: 1px solid #f7982a;
    line-height: 1;
    color: #f7982a;
    font-size: 14px;
    border-radius: 2px;
    margin-right: 5px;
    margin-bottom: 5px;
    white-space: nowrap;
  }

  .space-item {
    display: flex;
    font-size: 16px;
    color: #555;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
  }

  .space-item .span-left {
    white-space: nowrap;
  }

  .space-item .span-orange {
    font-size: 20px;
    color: #f7982a;
    line-height: 1;
  }

  .space-item .span-right {
    color: #777;
  }

  .container-footer span.apply-btn {
    background: #f7982a;
    color: #fff;
    flex: 1.5;
    line-height: 40px;
  }

  .space-block-title {
    font-size: 20px;
  }

  .space-block-title:before {
    content: '';
    display: inline-block;
    vertical-align: -3px;
    width: 3px;
    height: 20px;
    background: #f7982a;
    margin-right: 4px;
  }

  .space-block-content .space-list {
    overflow: hidden;
  }

  .space-block-content .space-list .space-item {
    width: 50%;
    float: left;
  }

  .space-passage {
    font-size: 15px;
    text-indent: 2em;
    margin-top: 10px;
    color: #333;
  }

  .halfwidth-item {
    width: 50%;
    display: inline-block;
  }

</style>
